package com.yueyang.sojourn.server.controller.wx;

import com.yueyang.sojourn.server.common.LoginNeedless;
import com.yueyang.sojourn.server.model.vo.SojournProjectVo;
import com.yueyang.sojourn.server.service.sojourn.project.ReadProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yemingxing
 * @summary
 * @Copyright (c) 2020, Yueyang Group All Rights Reserved.
 * @since 2020-02-26
 */
@RestController
@RequestMapping("/api/wx/project")
@Api(tags = "(小程序)项目 API")
public class ApiProjectController {

    @Autowired
    private ReadProjectService readProjectService;

    @LoginNeedless
    @ApiOperation(value = "根据项目id查询项目详情")
    @GetMapping("/{projectId}")
    public SojournProjectVo findById(@ApiParam(value = "项目id", required = true) @PathVariable long projectId) {
        return readProjectService.selectVoByPrimaryKey(projectId);
    }
}
